<template>
  <tool-page title="截取随机字符" :value="value" @generate="generate" :remark="remark">
    <template #extra>
      <Input type="textarea" v-model="inputValue" :rows="4" placeholder="请输入"/>
    </template>
    <template #buttonBefore>
      <input-number v-model="len" placeholder="请输入长度" :min="1" controls-outside></input-number>
    </template>
  </tool-page>
</template>

<script>
export default {
  name: "RandCutString",
  data() {
    return {
      value: '',
      inputValue: '',
      len: 1,
      remark: '输入一段文字，随机截取一段字符'
    }
  },
  methods: {
    generate() {
      if (!this.inputValue) {
        this.$Message.warning("请输入内容");
      }
      this.value = this.simpleUtils.dicingChar(this.inputValue, this.len);
    }
  }
}
</script>

<style scoped>

</style>
